package com.bw.rbac.controller;


import com.bw.rbac.entity.Result;
import com.bw.rbac.service.ITrainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 青山
 * @since 2022-05-27
 */
@RestController
@RequestMapping("/train")
public class TrainController {

    @Autowired
    ITrainService iTrainService;


    @RequestMapping("/del")
    public Result<String> del(Integer id) {
        boolean b = iTrainService.removeById(id);
        if(b){
            return new Result<>(200,"","删除成功");
        }else{
            return new Result<>(400,"删除失败","删除失败");
        }
    }

}
